package com.wuwangfu.entity;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @Description：最后结果输出的格式类
 * @Author：jcshen
 * @Date：2023-07-04
 */
@Data
@NoArgsConstructor
@ToString
public class ItemEventCount {

    public String itemId;     // 商品ID
    public String type;     // 事件类型
    public long windowStart;  // 窗口开始时间戳
    public long windowEnd;  // 窗口结束时间戳
    public long viewCount;  // 商品的点击量

    public static ItemEventCount of(String itemId, String type, long windowStart, long windowEnd, long viewCount) {
        ItemEventCount result = new ItemEventCount();
        result.itemId = itemId;
        result.type = type;
        result.windowStart = windowStart;
        result.windowEnd = windowEnd;
        result.viewCount = viewCount;
        return result;
    }

}
